package com.cy.dda.web.front.collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cy.dda.model.PageBean;
import com.cy.dda.model.query.collection.RepayRecordListQuery;
import com.cy.dda.model.vo.collection.RepayRecordListVO;
import com.cy.dda.service.collection.RepayRecordService;
import com.cy.dda.web.BaseController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

/**
 * 前台-回款记录
 *
 * @author: tanyilin
 * @create: 2018年11月14日 下午5:13:33
 */
@Slf4j
@RestController
@RequestMapping("/user/repay/record")
@Api(tags = "前台-回款记录")
public class RepayRecordController extends BaseController {

	@Autowired
	private RepayRecordService repayRecordService;
	
	@ApiOperation("回款记录列表")
	@GetMapping("/list")
	public PageBean<RepayRecordListVO> list(RepayRecordListQuery query) {
		PageBean<RepayRecordListVO> pageBean = repayRecordService.selectRepayRecordList(query);
		return pageBean;
	}
	
	@ApiOperation("（催收员用户）我的回款记录列表")
	@GetMapping("/my/list")
	public PageBean<RepayRecordListVO> myList(RepayRecordListQuery query) {
		Long userId = this.getUser().getUserId();
		query.setUserId(userId);
		query.setCasesId(null);
		query.setCustomerId(null);
		PageBean<RepayRecordListVO> pageBean = repayRecordService.selectRepayRecordList(query);
		return pageBean;
	}
	
}
